var form;
var $;
var table;
var layer;
layui.use(['form','jquery','table','layer'],function() {
    form = layui.form;
    $ = layui.$;
    table = layui.table;
    layer = layui.layer;
});
var user = JSON.parse(localStorage.getItem('user'));
//添加查询的操作日志
// $.ajax({
//     url:'/Product/addProductOperationRecord',
//     dataType:'json',
//     data:{
//         "dictValue":"查询反馈日志","cssClass":"查询","createBy":user.userId,
//         "remark":"无内容"
//     }
// });

$.ajax({
    url:'/course/getCourseById',
    dataType:'json',
    data:{"courseId":$('#proId',window.parent.document).val()},
    success:function (data) {
        data = data.data;
        console.log(data);
        $('input[name = id]').val(data.id);
        $('input[name = courseName]').val(data.courseName);
        $('input[name = name]').val(data.name);
        if(data.courseStatus == 2){
            data.courseStatus = "上架";
        }else if(data.courseStatus == 3){
            data.courseStatus = "下架";
        }
        $('input[name = courseStatus]').val(data.courseStatus);
        $('input[name = saleNum]').val(data.saleNum);
        $('input[name = courseLabel]').val(data.courseLabel);
        $('input[name = likeNum]').val(data.likeNum);
        $('input[name = collectNum]').val(data.collectNum);
        $('input[name = courseNprice]').val(data.courseNprice);
        $('#courseIntro').val(data.courseIntro);
        $('#url').html('<img src='+data.url+' style="float:left; width:155px;"/>');
    }
});